<?php include '../../authorization_check.php' ?>
<?php include '../../checkSecretaryOnly.php' ?>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-9">
<title>View Course Enrollment Numbers</title>
<SCRIPT TYPE="text/javascript" src= "../../commonutils/util/util.js"> </SCRIPT>

</head>
<style type="text/css">
/* th {text-align: right} */
</style>
<body>

<?php include 'top.html' ?>


<?php
  session_start();
  $programCode = $_SESSION['programCode'];
  $semesterID = $_SESSION['semesterID'];
  $year = $_SESSION['year'];
  $semesterName = $_SESSION['semesterName'];
  
	echo " <p>You are currenttly working in <b> <font color=#00008B>".$year."-".$semesterName."</font> </b> semester. </p>";
    echo " <hr color=blue>";
    
?>
  
<p>
<table border=1 cellpadding=3>
<tr>
<th>INSTRUCTOR NAME </th>
<th>BEGIN DATE </th>
<th>END DATE </th>
</tr>
<?php
require_once '../../commonutils/db/DBConnectionManager.php';

	$sqlquery = " select concat(firstName, ' ', lastName) as iname, lp.beginDate, lp.endDate ".
				" from instructor i, leavePeriod lp ".
				" where i.instructorID = lp.instructorID and lp.semesterID = ". $semesterID.
				" order by beginDate desc, iname" ;
	 
	/* // echo $sqlquery."<br>";  */

	$result = DBConnectionManager::query($sqlquery);
	while($row = mysql_fetch_assoc($result)){
		echo "<tr>";
		echo "<td>".$row['iname']." &nbsp;</td>";
		echo "<td>".$row['beginDate']." &nbsp;</td>";
		echo "<td>".$row['endDate']."     &nbsp;</td>";

		echo "</tr>";		
	}

?>

</table>
</p>  

<?php include 'bottom.php' ?>

</body>


</html>